package com.spic.business.accident.exterevents.selfInspectionReport.service.impl;

import java.util.List;
import com.spic.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.spic.business.accident.exterevents.selfInspectionReport.mapper.AccidentExternalEventInspectionReportMapper;
import com.spic.business.accident.exterevents.selfInspectionReport.domain.AccidentExternalEventInspectionReport;
import com.spic.business.accident.exterevents.selfInspectionReport.service.IAccidentExternalEventInspectionReportService;

/**
 * 外部事件自查报告Service业务层处理
 * 
 * @author spic
 * @date 2021-12-03
 */
@Service
public class AccidentExternalEventInspectionReportServiceImpl implements IAccidentExternalEventInspectionReportService 
{
    @Autowired
    private AccidentExternalEventInspectionReportMapper accidentExternalEventInspectionReportMapper;

    /**
     * 查询外部事件自查报告
     * 
     * @param id 外部事件自查报告主键
     * @return 外部事件自查报告
     */
    @Override
    public AccidentExternalEventInspectionReport selectAccidentExternalEventInspectionReportById(Long id)
    {
        return accidentExternalEventInspectionReportMapper.selectAccidentExternalEventInspectionReportById(id);
    }

    /**
     * 查询外部事件自查报告列表
     * 
     * @param accidentExternalEventInspectionReport 外部事件自查报告
     * @return 外部事件自查报告
     */
    @Override
    public List<AccidentExternalEventInspectionReport> selectAccidentExternalEventInspectionReportList(AccidentExternalEventInspectionReport accidentExternalEventInspectionReport)
    {
        return accidentExternalEventInspectionReportMapper.selectAccidentExternalEventInspectionReportList(accidentExternalEventInspectionReport);
    }

    /**
     * 新增外部事件自查报告
     * 
     * @param accidentExternalEventInspectionReport 外部事件自查报告
     * @return 结果
     */
    @Override
    public int insertAccidentExternalEventInspectionReport(AccidentExternalEventInspectionReport accidentExternalEventInspectionReport)
    {
        accidentExternalEventInspectionReport.setCreateTime(DateUtils.getNowDate());
        return accidentExternalEventInspectionReportMapper.insertAccidentExternalEventInspectionReport(accidentExternalEventInspectionReport);
    }

    /**
     * 修改外部事件自查报告
     * 
     * @param accidentExternalEventInspectionReport 外部事件自查报告
     * @return 结果
     */
    @Override
    public int updateAccidentExternalEventInspectionReport(AccidentExternalEventInspectionReport accidentExternalEventInspectionReport)
    {
        accidentExternalEventInspectionReport.setUpdateTime(DateUtils.getNowDate());
        return accidentExternalEventInspectionReportMapper.updateAccidentExternalEventInspectionReport(accidentExternalEventInspectionReport);
    }

    /**
     * 批量删除外部事件自查报告
     * 
     * @param ids 需要删除的外部事件自查报告主键
     * @return 结果
     */
    @Override
    public int deleteAccidentExternalEventInspectionReportByIds(Long[] ids)
    {
        return accidentExternalEventInspectionReportMapper.deleteAccidentExternalEventInspectionReportByIds(ids);
    }

    /**
     * 删除外部事件自查报告信息
     * 
     * @param id 外部事件自查报告主键
     * @return 结果
     */
    @Override
    public int deleteAccidentExternalEventInspectionReportById(Long id)
    {
        return accidentExternalEventInspectionReportMapper.deleteAccidentExternalEventInspectionReportById(id);
    }
}
